package com.zhilianzhonghe.jinyu.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.example.jinyu.DonTai2Activity;
import com.example.jinyu.R;

public class ZuiXinDongTaiFragment extends Fragment {
	
	private String[] ss=new String[]{"23","asa","2412","dsdf","sfsfsw2","vsdsfds"};
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View v=inflater.inflate(R.layout.fg_dontai, container, false);
		ListView lv_dontai=(ListView) v.findViewById(R.id.lv_dontai);
		ArrayAdapter<String> adapter=new ArrayAdapter<String>(getActivity(), R.layout.item_str, R.id.item_tvstr, ss);
		lv_dontai.setAdapter(adapter);
		
		lv_dontai.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				// TODO Auto-generated method stub
				Intent int_dontai1=new Intent(getActivity(),DonTai2Activity.class);
				int_dontai1.putExtra("dd", ss[position]);
				startActivity(int_dontai1);
			}
		});
		
		
		return v;
	}
}
